

#pragma once

#include "../glm/dvec2.hpp"
#include "../math/CartesianCoordinateSystem.hpp"
#include "UTM.hpp"

CYBERTRON_BEGIN

class GIS
{
public:
	CybertronCoreAPI static Deg2UTM wgsToUTM(double longitude, double latitude);
	CybertronCoreAPI static Deg2UTM wgsToUTM(double longitude, double latitude, int zone);
	CybertronCoreAPI static Deg2UTM wgsToUTM(const dvec2& lonLat);
	CybertronCoreAPI static Deg2UTM wgsToUTM(const dvec3& lonLatAlt);

	CybertronCoreAPI static dvec3 utmToWGS(const Deg2UTM& utm);

	// Earth centered coordinate system
	// https://en.wikipedia.org/wiki/ECEF
	// center: mass center of earth
	// x: 0 degrees longitude (prime-meridian) at equator
	// y: 90 degrees east longitude at equator
	// z: points to north pole
	CybertronCoreAPI static dvec3 wgsToEcef(double longitude, double latitude, double altitude);
	CybertronCoreAPI static dvec3 wgsToEcef(const dvec3& lonLatAlt);
	CybertronCoreAPI static dvec3 wgsToEcef(const dvec2& lonLat);

	CybertronCoreAPI static dvec3 ecefToWGS(const dvec3& ecef);

	// Local east, north, up (ENU) coordinates
	// https://en.wikipedia.org/wiki/Axes_conventions
	// x: east
	// y: north
	// z: up
	CybertronCoreAPI static CartesianCoordinateSystem buildLocalEnu(const dvec3& ecef);
};

CYBERTRON_END
